#include<bits/stdc++.h>
using namespace std;
int r[100005];
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int n,x=100005,s=0,a=0;
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>r[i];
        if(r[i]!=1&&r[i]!=2) a=1;
    }
    if(a==1){
        for(int i=1;i<=n;i++){
            if(x>r[i]){
                x=r[i];
            }
        }
        for(int i=1;i<=n;i++){
            if(r[i]==x) s+=1;
        }
        cout<<s<<endl;
    }
    if(a==0){
        int m=0,d=0;
        for(int i=1;i<=n;i++){
            if(r[i]==1) m+=1;
            if(r[i]==2) d+=1;
        }
        if(m>=d) cout<<m<<endl;
        else cout<<d<<endl;
    }
    return 0;
}